<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta name="keywords" content="HTML, CSS, XML, XHTML, JavaScript">
        <meta name="description" content="Test on HTML and CSS">
        <meta name="author" content="Huoty">
        <meta http-equiv="refresh" content="30">
        <title>Web 设计</title>
        <link rel="shortcut icon" href="/mylogo/logo_k_icon_72.ico" type="image/x-icon" />
    </head>
    <body>
        Content: <input type="text" name="content">
        <input type="submit" onclick="strip()">
    </body>
</html> 
<script type='text/javascript' src='../jquery/jquery-2.1.3.min.js'></script>
<script type="text/javascript">
function strip()
{
    var content = $("input").val();
    content = content.replace(/(^\s*)|(\s*$)/g, "");
    alert("|" + content + "|\nlength:" + content.length);
}
</script>
